//
//  SpeakCell.m
//  HYHOME
//
//  Created by Mac on 16/2/14.
//  Copyright © 2016年 Mac. All rights reserved.
//

#import "SpeakCell.h"
#import "SpeakModel.h"
#import "UIImageView+WebCache.h"
#import "DKNightVersion.h"
@implementation SpeakCell


-(void)dealloc{


    
    [self.icon_url release];
    [self.name release];
    [self.image_urls release];
    [self.content release];
    [self.create_time release];
    
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    
    if (self) {
        
        
        [self createSubView];
        
    }
    


    return self;

}
- (void)createSubView{
    self.icon_url = [[UIImageView alloc]init];
    [self.contentView addSubview:self.icon_url];
    
    self.name = [[UILabel alloc]init];
    [self.contentView addSubview:self.name];

    self.content = [[UILabel alloc]init];
    [self.contentView addSubview:self.content];
    
    self.image_urls = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image_urls];
    
    self.create_time = [[UILabel alloc]init];
    [self.contentView addSubview:self.create_time];
    
    
    
    
    [self.icon_url release];
    [self.name release];
    [self.image_urls release];
    [self.content release];
    [self.create_time release];
    

}

- (void)layoutSubviews{

    self.icon_url.frame = CGRectMake(30.f, 30.f, 60.f, 60.f);
    self.icon_url.layer.masksToBounds = YES;
    self.icon_url.layer.cornerRadius = 30;
    
    self.name.frame = CGRectMake(120, 45, 150, 30);
    self.content.frame = CGRectMake(10, 90, self.frame.size.width - 10, 60);
    self.image_urls.frame = CGRectMake(0, 140, self.frame.size.width, 200);
    self.create_time.frame = CGRectMake(10, 350, 180, 30);
    
    


}

- (void)passModel:(SpeakModel *)model{

    [self.icon_url sd_setImageWithURL:[NSURL URLWithString:model.icon_url] placeholderImage:[UIImage imageNamed:@"jz"]];
    self.name.text = model.name;
    self.content.text = model.content;
    self.content.numberOfLines = 0;
    self.content.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor lightGrayColor]);

   
     [self.image_urls sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:[UIImage imageNamed:@"jz"]];
        
    
    
    self.create_time.text = model.create_time;
    


}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
